package com.ruoyi.t.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.t.mapper.TOrderUserMapper;
import com.ruoyi.t.domain.TOrderUser;
import com.ruoyi.t.service.ITOrderUserService;

/**
 * 订单Service业务层处理
 * 
 * @author YY
 * @date 2025-02-06
 */
@Service
public class TOrderUserServiceImpl implements ITOrderUserService 
{
    @Autowired
    private TOrderUserMapper tOrderUserMapper;

    /**
     * 查询订单
     * 
     * @param id 订单主键
     * @return 订单
     */
    @Override
    public TOrderUser selectTOrderUserById(Long id)
    {
        return tOrderUserMapper.selectTOrderUserById(id);
    }

    /**
     * 查询订单列表
     * 
     * @param tOrderUser 订单
     * @return 订单
     */
    @Override
    public List<TOrderUser> selectTOrderUserList(TOrderUser tOrderUser)
    {
        return tOrderUserMapper.selectTOrderUserList(tOrderUser);
    }

    /**
     * 新增订单
     * 
     * @param tOrderUser 订单
     * @return 结果
     */
    @Override
    public int insertTOrderUser(TOrderUser tOrderUser)
    {
        tOrderUser.setCreateTime(DateUtils.getNowDate());
        return tOrderUserMapper.insertTOrderUser(tOrderUser);
    }

    /**
     * 修改订单
     * 
     * @param tOrderUser 订单
     * @return 结果
     */
    @Override
    public int updateTOrderUser(TOrderUser tOrderUser)
    {
        tOrderUser.setUpdateTime(DateUtils.getNowDate());
        return tOrderUserMapper.updateTOrderUser(tOrderUser);
    }

    /**
     * 批量删除订单
     * 
     * @param ids 需要删除的订单主键
     * @return 结果
     */
    @Override
    public int deleteTOrderUserByIds(Long[] ids)
    {
        return tOrderUserMapper.deleteTOrderUserByIds(ids);
    }

    /**
     * 删除订单信息
     * 
     * @param id 订单主键
     * @return 结果
     */
    @Override
    public int deleteTOrderUserById(Long id)
    {
        return tOrderUserMapper.deleteTOrderUserById(id);
    }
}
